﻿<Window x:Class="XmlStudio.Dialogs.AddXsdAttributeDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        loc:Translate.Uid="AddXsdAttributeDialog.WindowTitle"
        xmlns:userControls="clr-namespace:XmlStudio.Resources.UserControls" 
        xmlns:loc="clr-namespace:Tomers.WPF.Localization;assembly=Tomers.WPF.Localization" 
        Title="{loc:Translate 'Attribute'}"
        MinWidth="316"
        MinHeight="234"
        Style="{StaticResource XmlStudioDialogStyle}"
        WindowStartupLocation="CenterOwner"
        ResizeMode="CanResizeWithGrip"
        x:Name="AddXsdAttribute">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!--<ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Office2010/Silver.xaml" />-->
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
        <Border BorderBrush="Gray" BorderThickness="1" Margin="{StaticResource DialogBoxMargin}" Background="{StaticResource DialogBackgoundBrush}">
            <Grid Margin="{StaticResource DialogBoxMargin}" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="{StaticResource GridRowHeight}"/>
                    <RowDefinition Height="{StaticResource GridRowHeight}" />
                    <RowDefinition Height="{StaticResource GridRowHeight}" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="30*" />
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <TextBlock Height="{StaticResource TextBlockHeight}" Grid.Row="0" loc:Translate.Uid="AddXsdAttributeDialog.Prefix" Text="{loc:Translate Prefix:}" />
                <TextBlock Height="{StaticResource TextBlockHeight}" Grid.Row="1" loc:Translate.Uid="AddXsdAttributeDialog.NamespaceURI" Text="{loc:Translate NamespaceURI:}" />
                <TextBlock Height="{StaticResource TextBlockHeight}" Grid.Row="2" loc:Translate.Uid="AddXsdAttributeDialog.LocalName" Text="{loc:Translate LocalName:}" />
                <TextBlock Height="{StaticResource TextBlockHeight}" Grid.Row="3" loc:Translate.Uid="AddXsdAttributeDialog.Value" Text="{loc:Translate Value:}" />

                <TextBox Margin="{StaticResource TextBoxMargin}" Height="{StaticResource TextBoxHeight}" Text="{Binding ElementName=AddXsdAttribute, Path=Attribute.Prefix, Mode=OneWay}" MinWidth="157" Grid.Column="1" Grid.Row="0" x:Name="prefixTextBox" />
                <TextBox Margin="{StaticResource TextBoxMargin}" Height="{StaticResource TextBoxHeight}" Text="{Binding ElementName=AddXsdAttribute, Path=Attribute.NamespaceURI, Mode=OneWay}" MinWidth="157" Grid.Column="1" Grid.Row="1" x:Name="namespaceURITextBox" />
                <!--<TextBox Margin="{StaticResource TextBoxMargin}" Height="{StaticResource TextBoxHeight}" MinWidth="157" Grid.Column="1" Grid.Row="2" x:Name="localNameTextBox" />-->
                <ComboBox Height="{StaticResource ComboBoxHeight}" Margin="{StaticResource ComboBoxMargin}" ItemsSource="{Binding ElementName=AddXsdAttribute,Path=OptionalAttributes}"
                          DisplayMemberPath="LocalName" SelectedValuePath="LocalName" SelectedIndex="0"
                          x:Name="localNameComboBox" Grid.Column="1" Grid.Row="2" SelectionChanged="OnLocalNameComboBoxSelectionChanged" />

                <Grid Grid.Row="3" Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition MinHeight="30" Height="Auto" />
                        <!--<RowDefinition Height="{StaticResource GridRowHeight}" />-->
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <!--<ColumnDefinition />-->
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <!--<RadioButton x:Name="ListRadio" Grid.Row="0" Grid.Column="0" GroupName="Value" IsChecked="true" VerticalAlignment="Center" />
                    <RadioButton x:Name="CustomRadio" Grid.Row="1" Grid.Column="0" GroupName="Value" VerticalAlignment="Center" />-->

                    <ComboBox x:Name="localValuesComboBox" Height="{StaticResource ComboBoxHeight}" Margin="{StaticResource ComboBoxMargin}"  Grid.Row="0" Grid.Column="1" />
                    <ListBox x:Name="localValuesListBox" Height="100" Margin="{StaticResource ListBoxMargin}" Grid.Row="0" Grid.Column="1" SelectionMode="Multiple" />
                    <TextBox x:Name="valueTextBox" Height="{StaticResource TextBoxHeight}" Margin="{StaticResource TextBoxMargin}" Text="{Binding ElementName=AddXsdAttribute, Path=Attribute.Value, Mode=OneWay}" MinWidth="157" Grid.Column="1" Grid.Row="0"  />
                </Grid>

                <userControls:OKCancelButtons OKClicked="OnSubmit" Margin="0 7 0 0" Grid.Row="4" Grid.ColumnSpan="2" />
            </Grid>
        </Border>
    </ScrollViewer>
</Window>
